<template>
	<div class="msite">
		<header-top></header-top>
		<icons :entries="entries"></icons>
		<msite-swiper :swiperList="swiperList"></msite-swiper>
		<shoplist :restaurantList="restaurantList"></shoplist>
	</div> 	
</template>

<script>
	import axios from 'axios'
	import headerTop from 'components/headerTop/headerTop' 
	import Icons from 'components/icons/icons' 
	import MsiteSwiper from 'components/MsiteSwiper/MsiteSwiper' 
	import shoplist from 'components/shoplist/shoplist' 
	export default{
		data() {
			return {
				entries:[],
				swiperList:[],
				restaurantList:[]
			}
		},
		methods: {
			getMsiteInfo () {
		  		axios.get('/api/index.json')
		  		  .then(this.getMsiteInfoSucc)
		  	},
		  	getMsiteInfoSucc (res) {
		  		res=res.data
		  		if (res.ret && res.data) {
		  			const data = res.data
		  			this.entries=data.Entries
		  			this.swiperList=data.swiperList
		  			this.restaurantList=data.items
		  			console.log(this.restaurantList)
		  		}
		  	}
		},
		mounted() {
			this.getMsiteInfo()
			
		},
		components: {
			headerTop,
			Icons,
			MsiteSwiper,
			shoplist
		}
		
	}
</script>

<style lang="stylus" scoped>
</style>